//
//  Target_Main.m
//  Main
//
//  Created by 于鹏 on 2017/8/11.
//  Copyright © 2017年 YIVIEW. All rights reserved.
//

#import "Target_Main.h"
#import "XLTabBarController.h"
#import "XLNavigationController.h"
@implementation Target_Main

- (UITabBarController *)Action_tabBarController:(NSDictionary *)params {
    XLTabBarController *tabBar = [[XLTabBarController alloc]init];
    return tabBar;
}

- (UINavigationController *)Action_navBarController:(NSDictionary *)params {
    UIViewController *rootVC = params[@"rootVC"];
    XLNavigationController *nav = [[XLNavigationController alloc]initWithRootViewController:rootVC];
    return nav;
}

//使用前提条件:已经设置过rootVC
- (id)Action_setNavBarRootViewController:(NSDictionary *)params {
    UIViewController *rootVC = params[@"rootVC"];
    XLNavigationController *nav = [[XLNavigationController alloc]initWithRootViewController:rootVC];
    [[UIApplication sharedApplication].keyWindow setRootViewController:nav];
    return nil;
}

- (id)Action_setTabBarRootViewController:(NSDictionary *)params {
    XLTabBarController *tabBar = [[XLTabBarController alloc]init];
     [[UIApplication sharedApplication].keyWindow setRootViewController:tabBar];
    return nil;
}
@end
